<template>
	<view class="par_preview">
		<view class="preview_item" v-for="(item,index) in paramsTables" :key="index">
			<view class="item_top">
				<image src="../../static/image/canshu_one@2x.png"></image>
				<text>{{item.equipment_type_name}}</text>
			</view> 
			<view class="item_con" v-for="(v,index) in item.equipment_type_list" :key="index">
				<view class="item_con_t">
					<image src="../../static/image/canshu_title@2x.png"></image>
					<text>{{v.name}}</text>
				</view>
				<view class="item_con_m clearfix">
					<view v-for="i in v.object_params" :key="i.equipment_id">{{i.object_desc}}: {{i.object_val}}{{i.object_unit}} </view> 
				</view>
			</view>
		</view> 
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentId: '',
				paramsTables: ''
			};
		},
		onLoad(option) {
			this.currentId = option.id
		},
		mounted() {
			this.getParamsTable()
		},
		methods: {
			getParamsTable() {
				let that = this
				that.$http({
					url: '/wxapi/ParameterListApi/paramsTable',
					data: {
						station_id: that.currentId
					},
					method: 'POST'
				}).then(res => {
					if (res.code == 200) { 
						that.paramsTables = res.data
						console.log(that.paramsTables)
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.par_preview {
		.preview_item {
			.item_top {
				padding: 0 50rpx;
				height: 75rpx;
				line-height: 75rpx;
				font-size: 36rpx;
				color: #fff;
				background-color: #9DCFFB;

				image {
					margin-right: 30rpx;
					width: 46rpx;
					height: 46rpx;
				}
			}

			.item_con {
				padding: 20rpx 40rpx;
				// height: 300rpx;
				background-color: #fff;

				.item_con_t {
					height: 82rpx;
					line-height: 82rpx;
					font-size: 30rpx;
					color: #FDA03C;

					image {
						margin-right: 20rpx;
						width: 28rpx;
						height: 28rpx;
					}
				}

				.item_con_m {
					view {
						margin: 10rpx;
						padding: 0 10rpx;
						float: left;
						min-width: 280rpx;
						height: 50rpx;
						line-height: 50rpx;
						text-align: center;
						border: 1px solid #B4B4B4;
						border-radius: 10rpx;
					}
 
				}
			}
		}
	}
</style>
